home *** CD-ROM | disk | FTP | other *** search
/ QuickTime 2.0 Developer Kit / QuickTime 2.0 Developer Kit.iso / mac / MAC / Programming Stuff / Interfaces / CIncludes / CommResources.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-11-11  |  3.8 KB  |  118 lines  |  [TEXT/MPS ]

  1. /*
  2.      File:        CommResources.h
  3.  
  4.      Copyright:    © 1984-1994 by Apple Computer, Inc.
  5.                  All rights reserved.
  6.  
  7.      Version:    Universal Interfaces 2.0a3  ETO #16, MPW prerelease.  Friday, November 11, 1994. 
  8.  
  9.      Bugs?:        If you find a problem with this file, send the file and version
  10.                  information (from above) and the problem description to:
  11.  
  12.                      Internet:    apple.bugs@applelink.apple.com
  13.                      AppleLink:    APPLE.BUGS
  14.  
  15. */
  16.  
  17. #ifndef __COMMRESOURCES__
  18. #define __COMMRESOURCES__
  19.  
  20.  
  21. #ifndef __OSUTILS__
  22. #include <OSUtils.h>
  23. #endif
  24. /*    #include <Types.h>                                            */
  25. /*        #include <ConditionalMacros.h>                            */
  26. /*    #include <MixedMode.h>                                        */
  27. /*    #include <Memory.h>                                            */
  28.  
  29. #ifdef __cplusplus
  30. extern "C" {
  31. #endif
  32.  
  33. #if GENERATINGPOWERPC
  34. #pragma options align=mac68k
  35. #endif
  36.  
  37. #ifdef __CFM68K__
  38. #pragma lib_export on
  39. #endif
  40.  
  41.  
  42. enum {
  43. /*    tool classes (also the tool file types)    */
  44.     classCM                        = 'cbnd',
  45.     classFT                        = 'fbnd',
  46.     classTM                        = 'tbnd'
  47. };
  48.  
  49. enum {
  50. /*    version of the Comm Resource Manager    */
  51.     curCRMVersion                = 2,
  52. /* constants general to the use of the Communications Resource Manager */
  53.     crmType                        = 9,                            /* queue type    */
  54.     crmRecVersion                = 1,                            /* version of queue structure */
  55. /*    error codes */
  56.     crmGenericError                = -1,
  57.     crmNoErr                    = 0
  58. };
  59.  
  60. /* data structures general to the use of the Communications Resource Manager */
  61. typedef OSErr CRMErr;
  62.  
  63. struct CRMRec {
  64.     QElemPtr                        qLink;                        /*reserved*/
  65.     short                            qType;                        /*queue type -- ORD(crmType) = 9*/
  66.     short                            crmVersion;                    /*version of queue element data structure*/
  67.     long                            crmPrivate;                    /*reserved*/
  68.     short                            crmReserved;                /*reserved*/
  69.     long                            crmDeviceType;                /*type of device, assigned by DTS*/
  70.     long                            crmDeviceID;                /*device ID; assigned when CRMInstall is called*/
  71.     long                            crmAttributes;                /*pointer to attribute block*/
  72.     long                            crmStatus;                    /*status variable - device specific*/
  73.     long                            crmRefCon;                    /*for device private use*/
  74. };
  75. typedef struct CRMRec CRMRec;
  76.  
  77. typedef CRMRec *CRMRecPtr;
  78.  
  79. extern pascal CRMErr InitCRM(void);
  80. extern pascal QHdrPtr CRMGetHeader(void);
  81. extern pascal void CRMInstall(CRMRecPtr crmReqPtr);
  82. extern pascal OSErr CRMRemove(CRMRecPtr crmReqPtr);
  83. extern pascal CRMRecPtr CRMSearch(CRMRecPtr crmReqPtr);
  84. extern pascal short CRMGetCRMVersion(void);
  85. extern pascal Handle CRMGetResource(ResType theType, short theID);
  86. extern pascal Handle CRMGet1Resource(ResType theType, short theID);
  87. extern pascal Handle CRMGetIndResource(ResType theType, short index);
  88. extern pascal Handle CRMGet1IndResource(ResType theType, short index);
  89. extern pascal Handle CRMGetNamedResource(ResType theType, ConstStr255Param name);
  90. extern pascal Handle CRMGet1NamedResource(ResType theType, ConstStr255Param name);
  91. extern pascal void CRMReleaseResource(Handle theHandle);
  92. extern pascal Handle CRMGetToolResource(short procID, ResType theType, short theID);
  93. extern pascal Handle CRMGetToolNamedResource(short procID, ResType theType, ConstStr255Param name);
  94. extern pascal void CRMReleaseToolResource(short procID, Handle theHandle);
  95. extern pascal long CRMGetIndex(Handle theHandle);
  96. extern pascal short CRMLocalToRealID(ResType bundleType, short toolID, ResType theType, short localID);
  97. extern pascal short CRMRealToLocalID(ResType bundleType, short toolID, ResType theType, short realID);
  98. extern pascal OSErr CRMGetIndToolName(OSType bundleType, short index, Str255 toolName);
  99. extern pascal OSErr CRMFindCommunications(short *vRefNum, long *dirID);
  100. extern pascal Boolean CRMIsDriverOpen(ConstStr255Param driverName);
  101. extern pascal CRMErr CRMParseCAPSResource(Handle theHandle, ResType selector, unsigned long *value);
  102. extern pascal OSErr CRMReserveRF(short refNum);
  103. extern pascal OSErr CRMReleaseRF(short refNum);
  104.  
  105. #ifdef __CFM68K__
  106. #pragma lib_export off
  107. #endif
  108.  
  109. #if GENERATINGPOWERPC
  110. #pragma options align=reset
  111. #endif
  112.  
  113. #ifdef __cplusplus
  114. }
  115. #endif
  116.  
  117. #endif /* __COMMRESOURCES__ */
  118.